﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example03.aspx.cs" Inherits="Chapter29.Example03" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 29-3 启用和禁用样式表</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    <style title="cor styles">
        p {
            border: medium double black;
            background-color: lightgray;
        }

        #block1 {
            color: white;
            border: thick solid black;
            background-color: gray;
        }
    </style>
</head>
<body>
    <p id="block1">
        There are lots of different kinds of fruit - there are you over 500 varieties 
        of banana alone. By the time we add the countless 
        types of apples, oranges, and other well-known fruit, we are 
        faced with thousands of choices.
    </p>
    <div>
        <button id="pressme">Press Me</button>
    </div>
    <script>
        document.getElementById("pressme").onclick = function () {
            document.styleSheets[0].disabled = !document.styleSheets[0].disabled;
        }
    </script>
</body>
</html>
